# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

% Runtime::intrinsics.each do |intrinsic|
- name: <%= intrinsic.name %>
  space: <%= intrinsic.space %>
  class_name: <%= intrinsic.class_name %>
  method_name: <%= intrinsic.method_name %>
  safepoint_after_call: <%= intrinsic.respond_to?(:safepoint_after_call) %>
  safepoint: <%= intrinsic.respond_to?(:safepoint) %>
  private: <%= intrinsic.respond_to?(:private) %>
  signature:
    ret: "<%= intrinsic.signature.ret %>"
    args: <%= intrinsic.signature.args %>
  impl: <%= intrinsic.wrapper_impl %>
  impl_signature:
    ret: "<%= get_ret_effective_type(intrinsic.signature.ret) %>"
    args: <%= (!intrinsic.static ? [get_effective_type(intrinsic.class_name)] : []) + intrinsic.signature.args.map { |t| get_effective_type(t) }.flatten %>
%   if intrinsic.need_abi_wrapper?
  orig_impl: <%= intrinsic.impl %>
  orig_impl_signature:
    ret: "<%= get_ret_type(intrinsic.signature.ret) %>"
    args: <%= (!intrinsic.static ? [get_type(intrinsic.class_name)] : []) + intrinsic.signature.args.map { |t| get_type(t) }.flatten %>
%   end
  need_decl: <%= intrinsic.impl.start_with?(Runtime::intrinsics_namespace) %>
  builtin: <%= intrinsic.respond_to?(:builtin) && intrinsic.builtin %>
  exception: <%= intrinsic.respond_to?(:exception) && intrinsic.exception %>
% end
